//
//  UIBarButtonItem+Extension.swift
//  weibo10
//
//  Created by mac on 15/10/27.
//  Copyright © 2015年 itheima. All rights reserved.
//

import UIKit

extension UIBarButtonItem {
    convenience init(imageName: String, target: AnyObject?, actionName: String?){
        let button = UIButton(imageName: imageName, backImageName: nil)
        if let actionName = actionName {
            button.addTarget(target, action: Selector(actionName), forControlEvents: UIControlEvents.TouchUpInside)
        }
        self.init(customView: button)
    }

}